Learn R Programming

PHSMM (version 1.0)

Bernoulli distribution: Bernoulli distribution

Description

Probability mass function and cumulative distribution function of the Bernoulli distribution.

Usage

dbern(y, prob)
pbern(y, prob)

Arguments

y

a vector of zeros and ones.

prob

probability.

Value

dbern returns the probability mass function, pbern returns the cumulative distribution function.

Details

The code relies on the functions dbinom and pbinom with size=1 and log=FALSE.

References

See the documentation for dbinom and pbinom for more details.

Examples

Run this code
# NOT RUN {
dbern(c(0,1),0.4)
pbern(c(0,1),0.4)
# }

Run the code above in your browser using DataLab